<?php
include 'chat/config.inc.php';
//获取平台的get
$username = @$_POST['username'];
$nickname = $_POST['nickname'];
$userInfo = mysql_query("select nickname from wwk_chat_user where username = '{$username}'");
$userNicknameInfo = mysql_fetch_row($userInfo);
if ($userNicknameInfo[0]) {
  $a = array('code' => 0);
  echo json_encode($a);exit;
}
$setNick = mysql_query("update wwk_chat_user set nickname = '{$nickname}' where username = '{$username}'");
$a = array(
    'code' => 1,
    'nickname' => $nickname
);
echo json_encode($a);

?>